package com.jinzhending.service.wx.impl;

import com.jinzhending.comm.MoneyConvert;
import com.jinzhending.dao.wx.SignDao;
import com.jinzhending.entity.GoodsInfo;
import com.jinzhending.entity.WxSwiper;
import com.jinzhending.service.wx.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ProjectName: LieIdle
 * @Package: com.jinzhending.service.wx.impl
 * @Author: huat
 * @Date: 2020/4/3 17:01
 * @Version: 1.0
 */
@Service
public class IndexServiceImpl implements IndexService {
    @Autowired
    SignDao signDao;
    /**
     * 获取轮播图
     * @return
     */
    @Override
    public List<WxSwiper> getAllSwiper() {
        return signDao.getAllSwiper(0);
    }
    /**
     * 获取登陆轮播图
     * @return
     */
    @Override
    public List<WxSwiper> getAllSwiperLogin() {
         return signDao.getAllSwiper(1);
    }
    /**
     * 获取商品列表
     * @return
     */
    @Override
    public List<GoodsInfo> getGoods() {
        List<GoodsInfo> goodList=signDao.getGoods();
        for (GoodsInfo goodsInfo:goodList){
            goodsInfo.setGoodsMoneyNumber(MoneyConvert.fen2YuanStr(goodsInfo.getGoodsMoneyNumber()));
        }
        return goodList;
    }
}
